Skip to content

Add auto-update and improved validation for Block Layout#18

Merged
leeliu103 merged 1 commit intomainfrom
feat/block-layout-auto-update
Jan 23, 2026
Merged

Add auto-update and improved validation for Block Layout#18
leeliu103 merged 1 commit intomainfrom
feat/block-layout-auto-update

Conversation

@leeliu103
Copy link
Owner

Changes:

  • Remove manual "Update Visualization" button - Block Layout now auto-updates on input changes like Linear Layout
  • Add validation state tracking and button disable on validation errors
  • Fix parse error handling - decimals/NaN now show inline errors instead of throwing exceptions
  • Adopt LinearLayout's pattern: store NaN for invalid input and validate gracefully
  • Add smart validation short-circuiting to prevent confusing cascade errors
  • Add disabled button styling for better UX
  • Add comprehensive test coverage for new behavior

Technical improvements:

  • ParameterForm.getNumberValue() returns NaN instead of throwing
  • ParameterForm.onParamsChange() replaces onSubmit for auto-update flow
  • ParameterForm.onValidationChange() enables reactive button state
  • InputValidator short-circuits derived checks when dependent fields are invalid
  • "Show in Linear Layout" button automatically disables when validation fails

Tests:

  • Add ParameterForm.test.ts with decimal/NaN input coverage
  • Extend InputValidator.test.ts with parse error tests
  • Extend BlockLayoutTab.test.ts with validation button behavior tests
  • All 168 tests passing

@leeliu103 leeliu103 merged commit 2e3462e into main Jan 23, 2026
1 check passed
@leeliu103 leeliu103 deleted the feat/block-layout-auto-update branch January 23, 2026 20:48
Changes:
- Remove manual "Update Visualization" button - Block Layout now auto-updates on input changes like Linear Layout
- Add validation state tracking and button disable on validation errors
- Fix parse error handling - decimals/NaN now show inline errors instead of throwing exceptions
- Adopt LinearLayout's pattern: store NaN for invalid input and validate gracefully
- Add smart validation short-circuiting to prevent confusing cascade errors
- Add disabled button styling for better UX
- Add comprehensive test coverage for new behavior

Technical improvements:
- ParameterForm.getNumberValue() returns NaN instead of throwing
- ParameterForm.onParamsChange() replaces onSubmit for auto-update flow
- ParameterForm.onValidationChange() enables reactive button state
- InputValidator short-circuits derived checks when dependent fields are invalid
- "Show in Linear Layout" button automatically disables when validation fails

Tests:
- Add ParameterForm.test.ts with decimal/NaN input coverage
- Extend InputValidator.test.ts with parse error tests
- Extend BlockLayoutTab.test.ts with validation button behavior tests
- All 168 tests passing

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant